﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace NCP.Recruiting.Web.Framework.ActionExtend
{
    public class WordActionResult : ActionResult
    {
        private readonly string _url;
        public string Url
        {
            get { return _url; }
        }

        private readonly string _filename;
        public string FileName
        {
            get { return _filename; }
        }

        public WordActionResult(string pUrl, string pFileName)
        {
            _url = pUrl;
            _filename = pFileName;
        }

        public override void ExecuteResult(ControllerContext context)
        {
            HttpContext.Current.DownloadWord(this.Url, this.FileName);
        }
    }
}
